<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<title></title> 
<script type="text/javascript"> 
var $ = function(id) { return "string" == typeof id ? document.getElementById(id) : id; } 
var doConfirm = function(divId) { 
    $(divId).style.display = ""; 
    function closeDiv() { $(divId).style.display = "none"; } 
    return function(isOk) { 
        if (isOk) { alert("Do deleting..."); } 
        closeDiv(); 
    } 
} 
</script> 
<style type="text/css"> 
body { font-family: Arial; font-size: 13px; background-color: #FFFFFF; } 
#confirmDiv { width: 200px; height: 100px; border: dashed 1px black; position: absolute; 
left: 200px; top: 150px; } 
</style> 
</head> 
<body> 
<div> 
<input name="btn2" type="button" value="删除" onclick="doConfirm('confirmDiv');" /> 
<div id="confirmDiv" style="display: none;"> 
<div style='position: absolute; left: 50px; top: 15px;'> 
<p> 
你确定要删除吗?</p> 
<input type="button" value="确定" onclick="doConfirm('confirmDiv')(true);" /> 
<input type="button" value="取消" onclick="doConfirm('confirmDiv')(false);" /> 
</div> 
</div> 
</div> 
</body> 
</html> 